package command.facility;

/**
 * @author: zhouyang
 * @descrpition: 具体设备类 音响
 * @time: 2019-05-26 16:32
 */
public class Stereo {
    private String name;

    private int vol;

    public Stereo(String name,int vol) {
        this.name = name;
        this.vol = vol;
    }

    public void on(){
        System.out.println(this.name + " --- light on");
    }

    public void off(){
        System.out.println(this.name + " --- light off");
    }

    public void VolAdd(){
        System.out.println(this.name + "--- vol add "+ ++vol);
    }

    public void VolSub(){
        if(this.vol == 0){
            System.out.println("vol is zero,can not sub continue...");
        }else
            System.out.println(this.name + "--- vol sub "+ --vol);
    }
}
